Pain only stimulus intensity maps

Linear effects of stimlus intensity (low < med < high)

Pain only :: load dataset
clear all;
close all;
 
contrast_of_interest = 'P_simple_STIM_cue_high_gt_low'
contrast_of_interest = 'P_simple_STIM_cue_high_gt_low'
mount_dir = '/Volumes/spacetop_projects_cue/analysis/fmri/spm/univariate/model01_6cond_highlowcue_rampplateau/1stlevel';
contrast_name = {
'P_VC_STIM_cue_high_gt_low', 'V_PC_STIM_cue_high_gt_low', 'C_PV_STIM_cue_high_gt_low',...% contratss
'P_VC_STIM_stimlin_high_gt_low', 'V_PC_STIM_stimlin_high_gt_low', 'C_PV_STIM_stimlin_high_gt_low',...
'P_VC_STIM_stimquad_med_gt_other', 'V_PC_STIM_stimquad_med_gt_other', 'C_PV_STIM_stimquad_med_gt_other',...
'P_VC_STIM_cue_int_stimlin','V_PC_STIM_cue_int_stimlin', 'C_PV_STIM_cue_int_stimlin',...
'P_VC_STIM_cue_int_stimquad','V_PC_STIM_cue_int_stimquad','C_PV_STIM_cue_int_stimquad',...
'motor',... %motor
'P_simple_STIM_cue_high_gt_low','V_simple_STIM_cue_high_gt_low', 'C_simple_STIM_cue_high_gt_low',... % dummay contrasts
'P_simple_STIM_stimlin_high_gt_low', 'V_simple_STIM_stimlin_high_gt_low', 'C_simple_STIM_stimlin_high_gt_low',...
'P_simple_STIM_stimquad_med_gt_other','V_simple_STIM_stimquad_med_gt_other', 'C_simple_STIM_stimquad_med_gt_other',...
'P_simple_STIM_cue_int_stimlin', 'V_simple_STIM_cue_int_stimlin', 'C_simple_STIM_cue_int_stimlin',...
'P_simple_STIM_cue_int_stimquad', 'V_simple_STIM_cue_int_stimquad','C_simple_STIM_cue_int_stimquad',...
'P_simple_STIM_highcue_highstim', 'P_simple_STIM_highcue_medstim', 'P_simple_STIM_highcue_lowstim',... % pain events
'P_simple_STIM_lowcue_highstim', 'P_simple_STIM_lowcue_medstim', 'P_simple_STIM_lowcue_lowstim',...
'V_simple_STIM_highcue_highstim', 'V_simple_STIM_highcue_medstim', 'V_simple_STIM_highcue_lowstim',... % vicarious events
'V_simple_STIM_lowcue_highstim', 'V_simple_STIM_lowcue_medstim', 'V_simple_STIM_lowcue_lowstim',...
'C_simple_STIM_highcue_highstim', 'C_simple_STIM_highcue_medstim', 'C_simple_STIM_highcue_lowstim',... % cognitive events
'C_simple_STIM_lowcue_highstim', 'C_simple_STIM_lowcue_medstim', 'C_simple_STIM_lowcue_lowstim',...
'P_VC_CUE_cue_high_gt_low','V_PC_CUE_cue_high_gt_low','C_PV_CUE_cue_high_gt_low',...% cue epoch contrasts
'P_simple_CUE_cue_high_gt_low','V_simple_CUE_STIM_cue_high_gt_low','C_simple_CUE_cue_high_gt_low',...% cue epoch dummy
'G_simple_CUE_cue_high_gt_low',...
'P_VC_STIM', 'V_PC_STIM', 'C_PV_STIM'
};
index = find(strcmp(contrast_name, contrast_of_interest));
con_name = sprintf('*con_%04d.nii', index);
con_list = dir(fullfile(mount_dir, '*', con_name));
spm('Defaults','fMRI')
con_fldr = {con_list.folder}; fname = {con_list.name};
con_files = strcat(con_fldr,'/', fname)';
con_data_obj = fmri_data(con_files);
Using default mask: /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/brainmask_canlab.nii Direct calls to spm_defauts are deprecated. Please use spm('Defaults',modality) or spm_get_defaults instead. loading mask. mapping volumes. checking that dimensions and voxel sizes of volumes are the same. Pre-allocating data array. Needed: 28753056 bytes Loading image number: 72 Elapsed time is 9.633443 seconds. Image names entered, but fullpath attribute is empty. Getting path info. Number of unique values in dataset: 6899522 Bit rate: 22.72 bits
Pain only :: check data coverage
m = mean(con_data_obj);
m.dat = sum(~isnan(con_data_obj.dat) & con_data_obj.dat ~= 0, 2);
orthviews(m, 'trans'); % display
Compressed NIfTI files are not supported. SPM12: spm_check_registration (v7759) 10:40:01 - 16/01/2024 ======================================================================== Display /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 Grouping contiguous voxels: 1 regions
asdf
Pain only :: Plot diagnostics, before l2norm
drawnow; snapnow
 
[wh_outlier_uncorr, wh_outlier_corr] = plot(con_data_obj);
______________________________________________________________ Outlier analysis ______________________________________________________________ global mean | global mean to var | spatial MAD | Missing values | 0 images Retained 4 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 29.17% Expected 3.60 outside 95% ellipsoid, found 7 Potential outliers based on mahalanobis distance: Bonferroni corrected: 2 images Cases 29 44 Uncorrected: 7 images Cases 7 26 29 37 44 65 70 Retained 7 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 56.94% Expected 3.60 outside 95% ellipsoid, found 1 Potential outliers based on mahalanobis distance: Bonferroni corrected: 0 images Cases Uncorrected: 1 images Cases 58 Mahalanobis (cov and corr, q<0.05 corrected): 2 images Outlier_count Percentage _____________ __________ global_mean 3 4.1667 global_mean_to_variance 0 0 missing_values 0 0 rmssd_dvars 0 0 spatial_variability 1 1.3889 mahal_cov_uncor 7 9.7222 mahal_cov_corrected 2 2.7778 mahal_corr_uncor 1 1.3889 mahal_corr_corrected 0 0 Overall_uncorrected 8 11.111 Overall_corrected 2 2.7778
Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. SPM12: spm_check_registration (v7759) 10:40:38 - 16/01/2024 ======================================================================== Display /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 (all) /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions
 
 
Remove outlier
con = con_data_obj;
disp(strcat("current length is ", num2str(size(con_data_obj.dat,2))));
current length is 72
%for s = 1:length(wh_outlier_corr)
%disp(strcat("-------subject", num2str(s), "------"))
con.dat = con_data_obj.dat(:,~wh_outlier_corr);
con.image_names = con_data_obj.image_names(~wh_outlier_corr,:);
con.fullpath = con_data_obj.fullpath(~wh_outlier_corr,:);
con.files_exist = con_data_obj.files_exist(~wh_outlier_corr,:);
%end
disp(strcat("after removing ", num2str(sum(wh_outlier_corr)), " participants, size is now ",num2str(size(con.dat,2))));
after removing 2 participants, size is now 70
[path,n,e] = fileparts(con_fldr(wh_outlier_corr));
disp(strcat("participants that are outliers:... ", n));
"participants that are outliers:... sub-0074" "participants that are outliers:... sub-0093"
disp(n);
imgs2 = con.rescale('l2norm_images');

regression

Load behavioral cue effects. prepare covariates and identify intersection subjects with fMRI data

beh_cueeffect = readtable('/Users/h/Documents/projects_local/cue_expectancy/data/hlm/cue_stim_effects_scaling.csv')
beh_cueeffect = 342×22 table
 subtaskcue_raw_outcomecue_raw_outcome_sdcue_z_outcomecue_z_outcome_sdcue_raw_expectcue_raw_expect_sdcue_z_expectcue_z_expect_sdstim_raw_outcomestim_raw_outcome_sdstim_z_outcomestim_z_outcome_sdstim_raw_expectstim_raw_expect_sdstim_z_expectstim_z_expect_sdcuestim_raw_outcomecuestim_raw_outcome_regcuestim_z_outcomecuestim_z_outcome_reg
1'sub-0002''cognitive'4.54096.34330.12170.170123.903518.73400.59640.46744.489710.04040.12040.2692-3.343420.1072-0.08340.50171.01141.00931.01141.0012
2'sub-0003''cognitive'7.636617.10340.47161.056230.155025.17701.26061.05254.061211.02910.25080.6811-4.28527.4098-0.17910.30981.88041.70641.88041.1765
3'sub-0004''cognitive'1.62757.63270.07070.331533.774025.34291.08730.81590.93306.23880.04050.2710-1.03119.8240-0.03320.31631.74441.35931.74441.0290
4'sub-0005''cognitive'13.131041.44260.33301.051141.785737.36011.25171.11914.671929.82960.11850.7566-2.95908.8393-0.08860.26482.81072.49142.81071.1918
5'sub-0006''cognitive'5.148428.94670.15570.875330.562619.98911.06110.694015.865128.85800.47970.87267.058318.46690.24510.64120.32450.36460.32450.7810
6'sub-0007''cognitive'14.07679.62710.63500.434329.324611.57591.18690.468512.518711.45100.56470.5165-4.46029.2611-0.18050.37491.12441.11521.12441.0449
7'sub-0008''cognitive'2.370312.27560.14460.74916.125610.09980.45250.746013.749321.46450.83911.3099-1.99107.1383-0.14710.52730.17240.22850.17240.6224
8'sub-0009''cognitive'9.59097.98660.14850.123738.18098.91260.60780.14197.46108.15270.11550.12620.425811.40160.00680.18151.28551.25171.28551.0296
9'sub-0010''cognitive'9.25619.14270.43990.434536.366810.15281.42570.398012.392110.92350.58890.5191-7.959111.9403-0.31200.46810.74690.76580.74690.9062
10'sub-0011''cognitive'17.018022.77960.47310.633345.662419.75961.26660.548111.776824.31250.32740.6760-6.303714.4209-0.17490.40001.44501.41021.44501.1098
11'sub-0013''cognitive'16.088722.06320.35820.491359.356112.59221.28950.273614.990025.66190.33380.5714-2.362010.9018-0.05130.23681.07331.06871.07331.0183
12'sub-0014''cognitive'3.783210.75790.13780.391927.949016.75310.97900.58689.45859.61780.34450.3503-0.99958.3669-0.03500.29310.40000.45740.40000.8462
13'sub-0015''cognitive'32.960738.66490.53880.632155.208125.40300.99470.4577-14.978115.5663-0.24480.2545-12.858827.6116-0.23170.4975-2.2006-2.4296-2.20062.0377
14'sub-0016''cognitive'2.32376.04310.08160.212210.084415.70120.33000.51383.65195.75830.12820.2022-3.10064.3430-0.10150.14210.63630.71450.63630.9587
15'sub-0017''cognitive'6.692125.33970.27551.043251.433823.09101.49460.67104.194216.56940.17270.6821-9.442723.2133-0.27440.67461.59551.48091.59551.0877
16'sub-0018''cognitive'-2.749311.1383-0.12450.504521.13378.88171.36310.57289.026617.83610.40890.80790.16707.76270.01080.5007-0.3046-0.1745-0.30460.6214
17'sub-0019''cognitive'8.04877.43580.52740.487315.47088.84001.21490.69420.83495.57110.05470.36511.77509.84680.13940.77339.64094.93169.64091.4482
18'sub-0020''cognitive'15.262422.18840.55320.804319.796516.02910.85840.695027.602916.81601.00050.60953.496517.51090.15160.75930.55290.56860.55290.7764
19'sub-0021''cognitive'-5.007814.2768-0.16530.471143.539421.25121.59570.77882.02329.43530.06680.3114-12.470126.1608-0.45700.9588-2.4752-1.3257-2.47520.7825
20'sub-0023''cognitive'9.544225.49400.29390.784945.658010.35191.55170.351816.355927.05260.50360.8329-4.16729.7799-0.14160.33240.58350.60750.58350.8605
21'sub-0024''cognitive'2.643714.29660.11090.599844.62279.12971.43450.293511.33819.20450.47570.3862-1.56569.3068-0.05030.29920.23320.29530.23320.7528
22'sub-0025''cognitive'11.885229.93820.45861.155237.604210.38341.52550.421219.113019.29740.73750.7446-4.94598.9225-0.20060.36200.62180.64060.62180.8395
23'sub-0026''cognitive'1.376821.80520.05850.926530.490510.37181.67540.569915.773417.30020.67020.73512.12917.00950.11700.38520.08730.14170.08730.6337
24'sub-0028''cognitive'9.362525.58440.22100.604058.038413.73031.65670.391911.587510.76700.27360.2542-14.163217.1093-0.40430.48840.80800.82320.80800.9588
25'sub-0029''cognitive'0.37038.23100.03970.882111.20446.32651.21110.68395.66185.25850.60670.5635-1.81704.8322-0.19640.52230.06540.20570.06540.6471
26'sub-0030''cognitive'5.20279.40340.20290.366746.559414.13451.70390.517321.303611.20070.83080.43680.393624.71100.01440.90430.24420.27810.24420.6570
27'sub-0031''cognitive'6.467122.43010.21070.730719.146119.27560.64380.64826.068823.49580.19770.7654-8.332913.9642-0.28020.46961.06561.05631.06561.0108
28'sub-0032''cognitive'17.844934.90380.30460.595858.620018.12261.29230.39951.019024.53730.01740.4188-7.845124.1689-0.17290.532817.51309.334017.51301.2823
29'sub-0033''cognitive'16.899619.97830.64220.759240.958310.07461.45520.357912.090220.77460.45950.7895-7.049512.7113-0.25050.45161.39781.36741.39781.1252
30'sub-0034''cognitive'11.258429.11550.30310.783857.875716.04151.44200.399715.825225.59310.42600.689010.233722.91550.25500.57090.71140.72860.71140.9138
31'sub-0035''cognitive'-1.833518.2830-0.06800.678138.47909.10271.58290.374513.644328.85700.50611.0703-0.39699.9809-0.01630.4106-0.1344-0.0569-0.13440.6188
32'sub-0036''cognitive'10.978814.13210.42030.541137.305521.66061.17820.684110.435816.04440.39950.6143-20.694126.7478-0.65360.84471.05201.04751.05201.0149
33'sub-0037''cognitive'4.619226.61380.13980.805451.95449.32721.58670.284919.547425.27030.59150.7647-3.526310.1725-0.10770.31070.23630.27350.23630.7162
34'sub-0038''cognitive'10.577714.75900.26630.371631.904512.95810.92630.376212.813710.70340.32260.2695-9.141713.0254-0.26540.37820.82550.83810.82550.9574
35'sub-0039''cognitive'6.628315.25800.31000.713521.128616.10711.07280.81788.735410.25220.40850.4794-3.65558.6611-0.18560.43980.75880.78360.75880.9300
36'sub-0040''cognitive'10.350417.58350.30340.515445.001419.76231.18920.522310.171316.70540.29820.4897-2.677222.1902-0.07070.58641.01761.01601.01761.0040
37'sub-0041''cognitive'13.790218.99410.35010.482225.41437.01730.69670.192411.259413.58940.28580.3450-4.33256.0502-0.11880.16591.22481.20641.22481.0500
38'sub-0043''cognitive'5.564014.20110.10290.262625.876321.03350.63650.517413.781923.67900.25490.4379-4.820713.2506-0.11860.32590.40370.44410.40370.8789
39'sub-0044''cognitive'8.083512.10300.21210.317550.988319.29641.35070.511211.612414.77720.30460.38770.344311.47090.00910.30390.69610.72020.69610.9290
40'sub-0046''cognitive'24.792519.24980.42880.332949.197722.15860.95170.428726.680527.69150.46140.47897.190521.05990.13910.40740.92920.93180.92920.9777
41'sub-0047''cognitive'-4.190217.3474-0.10150.42042.395422.17450.07840.725624.998324.17910.60580.58592.440721.59460.07990.7066-0.1676-0.1227-0.16760.5595
42'sub-0050''cognitive'5.154614.62090.07440.211033.726717.38940.53660.27665.51138.76230.07950.1264-4.49427.7864-0.07150.12390.93530.94520.93530.9952
43'sub-0051''cognitive'15.135721.49080.48110.683139.912419.96481.30980.65521.385323.40250.04400.7439-3.710619.0527-0.12180.625310.92606.764710.92601.4187
44'sub-0052''cognitive'13.301014.86270.68650.767139.836914.03081.57540.55493.273816.86550.16900.87054.67129.47590.18470.37474.06293.34624.06291.4427
45'sub-0053''cognitive'11.941513.24270.68820.763229.944012.98391.53820.66708.107012.24220.46720.7056-0.219910.0518-0.01130.51641.47301.42101.47301.1506
46'sub-0055''cognitive'6.122220.32100.27000.896438.703912.03071.61450.50184.693818.99800.20700.83800.804011.38580.03350.47491.30431.25091.30431.0522
47'sub-0056''cognitive'15.706617.57140.51420.575223.312117.76960.77110.587812.965517.50300.42440.57300.188517.54510.00620.58041.21141.19631.21141.0630
48'sub-0057''cognitive'22.950616.86270.95160.699252.106220.24341.61390.6270-7.086828.7398-0.29381.1917-10.604610.1102-0.32850.3131-3.2385-3.9348-3.23852.7637
49'sub-0058''cognitive'-7.493616.5761-0.27240.602612.505519.95030.63871.01904.283527.26020.15570.99100.155616.75930.00790.8560-1.7494-1.2290-1.74940.6295
50'sub-0059''cognitive'1.19878.55870.05010.357710.29946.40840.47290.29435.85645.02300.24480.2099-2.47646.0788-0.11370.27910.20470.32070.20470.8436
51'sub-0060''cognitive'2.544618.43680.20571.490633.81787.75341.52810.35045.078712.12990.41060.9807-7.462911.1781-0.33720.50510.50100.58310.50100.8548
52'sub-0061''cognitive'24.674629.59730.66410.796564.436817.61561.75570.48009.129233.64690.24570.9055-3.832115.4191-0.10440.42012.70282.53472.70281.3358
53'sub-0062''cognitive'5.175122.11210.18210.778043.040415.38881.39520.498810.520729.52000.37011.0386-6.910417.6391-0.22400.57180.49190.53600.49190.8627
54'sub-0064''cognitive'30.596418.54091.22330.741363.320019.32131.81920.55515.219917.44980.20870.69772.18449.53800.06280.27405.86155.07995.86151.8394
55'sub-0065''cognitive'6.533311.70440.18970.339925.402019.59570.59460.45878.22019.26740.23870.2691-5.688313.5883-0.13320.31810.79480.81700.79480.9605
56'sub-0066''cognitive'0.389025.67170.02381.569323.334923.87841.19381.2216-1.320125.1146-0.08071.5352-4.701217.9001-0.24050.9158-0.2947-4.3389-0.29471.1137
57'sub-0068''cognitive'3.04955.35780.05580.098017.054919.78950.31700.36787.31266.54900.13370.1198-4.04216.2897-0.07510.11690.41700.48710.41700.9312
58'sub-0069''cognitive'1.78325.91930.04910.163128.58259.49100.87830.29166.19438.16930.17070.2251-7.155912.1381-0.21990.37300.28790.38690.28790.8962
59'sub-0070''cognitive'8.37799.37430.48310.540622.632513.85650.89560.54832.38357.96340.13740.45921.341510.37230.05310.41043.51502.77173.51501.3039
60'sub-0071''cognitive'-5.057422.0937-0.34301.49853.321712.03120.26580.962817.079325.51351.15841.73051.938922.62790.15521.8107-0.2961-0.2244-0.29610.3044
61'sub-0073''cognitive'-0.256613.4703-0.01140.59881.65914.86430.07770.22794.347910.47470.19330.4656-0.53276.0074-0.02500.2815-0.05900.1390-0.05900.8285
62'sub-0074''cognitive'5.898813.81700.09820.23010.201717.75970.00290.25397.16419.74170.11930.16230.938411.77420.01340.16830.82340.84500.82340.9812
63'sub-0075''cognitive'8.526218.67500.35110.769040.091419.15471.54950.7403-1.537721.1293-0.06330.87010.977918.42560.03780.7121-5.5446-17.7156-5.54461.4425
64'sub-0076''cognitive'0.400012.56290.01380.433637.937012.61191.34660.447721.860715.49320.75450.5348-3.86386.3935-0.13720.22690.01830.06120.01830.5778
65'sub-0077''cognitive'3.733328.63680.14891.141932.26989.75921.16180.351419.299328.41410.76961.1330-5.52038.0507-0.19870.28980.19340.23320.19340.6492
66'sub-0078''cognitive'14.450716.29900.43790.493936.94028.58011.04340.24240.703320.06490.02130.6081-3.780013.1893-0.10680.372520.54569.070820.54561.4079
67'sub-0079''cognitive'22.058020.07780.92640.843329.794519.00291.02680.65494.213712.11850.17700.509012.472615.30760.42980.52755.23484.42265.23481.6368
68'sub-0080''cognitive'7.548119.48340.14760.381026.550612.55260.61010.288511.465723.78000.22420.46503.75765.21220.08630.11980.65830.68570.65830.9374
69'sub-0081''cognitive'6.831814.44350.38070.804840.770314.33681.67880.590313.795712.62760.76870.7036-5.555910.0361-0.22880.41330.49520.52930.49520.7806
70'sub-0082''cognitive'-1.577113.4873-0.06550.5600-2.47451.5171-0.09750.05983.33664.22860.13850.17562.55422.13660.10070.0842-0.4727-0.1331-0.47270.8208
71'sub-0083''cognitive'9.881311.28660.30970.35386.50738.53290.22080.28966.68289.47420.20950.2970-3.79436.7962-0.12880.23061.47861.41631.47861.0829
72'sub-0084''cognitive'2.01777.19830.10900.389015.90369.33720.86900.51021.95626.18470.10570.33424.59148.36100.25090.45691.03141.02081.03141.0030
73'sub-0085''cognitive'-3.95486.8195-0.46640.8042-2.67877.1474-0.36230.9666-1.52440.6765-0.17980.07982.38147.95140.32201.07532.59445.63492.59440.6506
74'sub-0086''cognitive'11.325714.57920.49730.640139.38239.85511.46470.36658.847210.10650.38850.4438-1.786211.7341-0.06640.43641.28021.25171.28021.0784
75'sub-0087''cognitive'5.592734.02160.20151.225930.518620.08981.12780.742415.196631.21810.54761.1249-2.02629.0054-0.07490.33280.36800.40700.36800.7764
76'sub-0088''cognitive'15.273520.05150.30810.404527.855324.32220.64080.5596-3.334327.3853-0.06730.5524-5.204711.9733-0.11970.2755-4.5807-6.9713-4.58071.4024
77'sub-0089''cognitive'3.327113.33980.17830.71498.871710.70170.56890.68634.72239.12630.25310.4891-0.36937.5097-0.02370.48160.70460.75620.70460.9403
78'sub-0090''cognitive'1.83238.20620.06610.296323.544611.52570.95040.46529.102813.69510.32860.4944-1.29078.2869-0.05210.33450.20130.28040.20130.8024
79'sub-0091''cognitive'7.140014.71400.37150.765522.136818.94111.00760.86214.252115.36210.22120.79935.295514.35350.24100.65331.67921.54991.67921.1230
80'sub-0092''cognitive'24.436436.24990.67240.997549.363319.61421.15030.457111.077940.95610.30481.12708.547019.97270.19920.46542.20592.10602.20591.2817
81'sub-0093''cognitive'3.588517.91900.12730.635531.419718.31241.12190.65392.732613.07100.09690.4635-2.325112.5918-0.08300.44961.31321.22931.31321.0277
82'sub-0094''cognitive'2.998827.48640.10450.957947.939216.22551.66750.56447.947226.72970.27700.9315-3.318814.7081-0.11540.51160.37730.44690.37730.8650
83'sub-0095''cognitive'1.178710.73860.05090.463513.642814.15710.74870.77697.76327.17590.33510.3097-1.800015.1379-0.09880.83070.15180.24860.15180.7871
84'sub-0097''cognitive'-2.170411.0542-0.11500.585816.296216.07661.09101.076315.327913.47750.81220.71428.09758.34930.54210.5590-0.1416-0.0717-0.14160.4883
85'sub-0098''cognitive'4.314026.40430.12150.743743.460110.82951.45730.363111.434523.81390.32210.6707-2.162510.5896-0.07250.35510.37730.42740.37730.8483
86'sub-0099''cognitive'18.828715.79380.62480.524151.054022.41041.52260.668412.913115.85100.42850.5260-2.700326.3129-0.08050.78471.45811.42521.45811.1374
87'sub-0100''cognitive'5.187314.19530.28210.77209.343814.23040.60630.92335.895614.55990.32060.7918-0.806915.6584-0.05241.01600.87990.89730.87990.9708
88'sub-0101''cognitive'15.409022.05690.53980.772651.554813.94101.76390.47705.190825.96040.18180.9094-1.516513.5968-0.05190.46522.96852.65062.96851.3029
89'sub-0103''cognitive'2.302215.40020.13000.86935.18697.55950.59950.8737-0.63286.9578-0.03570.39281.65789.70610.19161.1218-3.63798.9940-3.63791.1718
90'sub-0104''cognitive'-1.368219.3069-0.05490.774234.957918.79391.42880.76826.525318.90350.26170.75808.380914.27060.34260.5833-0.2097-0.0489-0.20970.7491
91'sub-0105''cognitive'7.025314.32150.26800.546327.227313.80011.10860.56198.989315.52970.34290.5924-7.160310.2791-0.29160.41850.78150.80340.78150.9442
92'sub-0106''cognitive'15.591419.09910.35260.431955.558727.87481.35530.6800-7.586719.8597-0.17160.4491-5.771124.8312-0.14080.6058-2.0551-2.5189-2.05511.6326
93'sub-0107''cognitive'1.527912.36580.06680.540922.960113.54571.04390.6159-2.59968.8031-0.11370.3850-6.044214.1183-0.27480.6419-0.5877-1.5804-0.58771.2037
94'sub-0109''cognitive'8.912011.28810.53070.672333.385010.15691.52430.46383.469710.94380.20660.6518-3.235311.3228-0.14770.51702.56852.21762.56851.2686
95'sub-0111''cognitive'10.971216.06290.25920.379537.705814.59871.01670.39379.547213.88640.22560.3281-0.85676.3419-0.02310.17101.14921.13501.14921.0275
96'sub-0112''cognitive'13.875215.94230.41960.482142.113915.96311.11270.42184.955315.13410.14990.45776.484013.75120.17130.36332.80012.49782.80011.2346
97'sub-0114''cognitive'8.108022.91880.32740.925553.054233.23561.68181.053614.239920.04530.57500.8094-2.946217.1716-0.09340.54430.56940.59760.56940.8428
98'sub-0115''cognitive'4.11139.13130.27160.603223.075111.11811.21820.58692.469911.48930.16320.7590-0.131810.9337-0.00700.57721.66451.47301.66451.0932
99'sub-0116''cognitive'5.691123.61440.18680.775125.625110.98080.97680.418612.761918.54820.41890.60880.107410.57800.00410.40320.44590.48620.44590.8364
100'sub-0117''cognitive'3.66419.36060.16970.433414.258514.84390.90040.9374-0.50505.2763-0.02340.2443-0.69256.1074-0.04370.3857-7.25509.4231-7.25501.1977
pain_task = find(strcmp(beh_cueeffect.task, 'pain'));
 
pain_cueeffect = beh_cueeffect(pain_task, :);
 
% extract subject ids from contrast fMRI data object and intersect with
% behavioral data
nRows = size(con_data_obj.image_names, 1);
sub_ids = cell(nRows, 1);
 
for i = 1:nRows
sub_ids{i} = con_data_obj.image_names(i, 1:8);
end
 
sub_ids_table = table(sub_ids, 'VariableNames', {'sub'});
common_subs = intersect(sub_ids_table.sub, pain_cueeffect.sub)
common_subs = 71×1 cell
'sub-0014'
'sub-0026'
'sub-0028'
'sub-0029'
'sub-0030'
'sub-0031'
'sub-0033'
'sub-0035'
'sub-0039'
'sub-0040'
% Ensure beh_cueeffect.sub is a cell array for comparison
if ~iscell(pain_cueeffect.sub)
pain_cueeffect.sub = cellstr(pain_cueeffect.sub);
end
 
rows_to_keep = ismember(pain_cueeffect.sub, common_subs);
filtered_pain_cueeffect = pain_cueeffect(rows_to_keep, :);
 
% regenerate contrast filenames based on intersecting subject ids
% Initialize an empty cell array for the file paths
filteredcon_files = cell(length(common_subs), 1);
 
% Loop through each subject ID and construct the file path
for i = 1:length(common_subs)
filteredcon_files{i} = fullfile(mount_dir, common_subs{i}, [common_subs{i}, '_con_0020.nii']);
end
 

covariates "Cue effects (Raw outcome)"

Adding Raw covariates to fmri data obj
filtered_con_obj = fmri_data(filteredcon_files);
Using default mask: /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/brainmask_canlab.nii loading mask. mapping volumes. checking that dimensions and voxel sizes of volumes are the same. Pre-allocating data array. Needed: 28353708 bytes Loading image number: 71 Elapsed time is 9.417019 seconds. Image names entered, but fullpath attribute is empty. Getting path info. Number of unique values in dataset: 6767782 Bit rate: 22.69 bits
filtered_con_obj.X = filtered_pain_cueeffect.cue_raw_outcome;
plot(filtered_con_obj)
______________________________________________________________ Outlier analysis ______________________________________________________________ global mean | global mean to var | spatial MAD | Missing values | 0 images Retained 5 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 21.13% Expected 3.55 outside 95% ellipsoid, found 9 Potential outliers based on mahalanobis distance: Bonferroni corrected: 5 images Cases 16 29 37 44 69 Uncorrected: 9 images Cases 12 16 29 34 37 43 44 48 69 Retained 10 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 50.70% Expected 3.55 outside 95% ellipsoid, found 3 Potential outliers based on mahalanobis distance: Bonferroni corrected: 0 images Cases Uncorrected: 3 images Cases 12 20 33 Mahalanobis (cov and corr, q<0.05 corrected): 5 images Outlier_count Percentage _____________ __________ global_mean 4 5.6338 global_mean_to_variance 2 2.8169 missing_values 0 0 rmssd_dvars 0 0 spatial_variability 4 5.6338 mahal_cov_uncor 9 12.676 mahal_cov_corrected 5 7.0423 mahal_corr_uncor 3 4.2254 mahal_corr_corrected 0 0 Overall_uncorrected 11 15.493 Overall_corrected 5 7.0423
Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. SPM12: spm_check_registration (v7759) 10:41:36 - 16/01/2024 ======================================================================== Display /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 (all) /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions
ans = 71×1 logical array
0 0 0 0 0 0 0 0 0 0
cue_raw_outcome = regress(filtered_con_obj, .05, 'fdr')
Analysis: ---------------------------------- Design matrix warnings: ---------------------------------- No intercept detected, adding intercept to last column of design matrix Warning: Predictors are not centered -- intercept is not interpretable as stats for average subject Warning!!! Some observations have high leverage values relative to others, regression may be unstable. abs(z(leverage)) > 3 Warning!!! Too few variable names entered, less than size(X, 2). Names may be inaccurate. ______________________________________________________ Running regression: 99837 voxels. Design: 71 obs, 2 regressors, intercept is last Predicting exogenous variable(s) in dat.X using brain data as predictors, mass univariate Running in OLS Mode Model run in 0 minutes and 0.19 seconds Creating beta and t images, thresholding t images ______________________________________________________ Thresholding t images at 0.050000 fdr Image 1 FDR q < 0.050 threshold is 0.000620 Image 1 60 contig. clusters, sizes 1 to 328 Positive effect: 1235 voxels, min p-value: 0.00000055 Negative effect: 4 voxels, min p-value: 0.00024268 Image 2 FDR q < 0.050 threshold is 0.024139 Image 2 60 contig. clusters, sizes 1 to 328 Positive effect: 47979 voxels, min p-value: 0.00000000 Negative effect: 237 voxels, min p-value: 0.00001432
cue_raw_outcome = struct with fields:
analysis_name: '' input_parameters: [1×1 struct] input_image_metadata: [1×1 struct] X: [71×2 double] variable_names: {2×1 cell} C: [] contrast_names: {} contrast_summary_table: [0×0 table] diagnostics: [1×1 struct] warnings: {1×4 cell} b: [1×1 statistic_image] t: [1×1 statistic_image] df: [1×1 fmri_data] sigma: [1×1 fmri_data]
cue_raw_outcome.t = threshold(cue_raw_outcome.t, .05, 'fdr');
Image 1 FDR q < 0.050 threshold is 0.000620 Image 1 60 contig. clusters, sizes 1 to 328 Positive effect: 1235 voxels, min p-value: 0.00000055 Negative effect: 4 voxels, min p-value: 0.00024268 Image 2 FDR q < 0.050 threshold is 0.024139 Image 2 60 contig. clusters, sizes 1 to 328 Positive effect: 47979 voxels, min p-value: 0.00000000 Negative effect: 237 voxels, min p-value: 0.00001432
montage(cue_raw_outcome.t)
Setting up fmridisplay objects Compressed NIfTI files are not supported. sagittal montage: 77 voxels displayed, 1162 not displayed on these slices axial montage: 327 voxels displayed, 912 not displayed on these slices sagittal montage: 2496 voxels displayed, 45720 not displayed on these slices axial montage: 11716 voxels displayed, 36500 not displayed on these slices
ans =
fmridisplay with properties: overlay: '/Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz' SPACE: [1×1 struct] activation_maps: {[1×1 struct] [1×1 struct]} montage: {[1×1 struct] [1×1 struct] [1×1 struct] [1×1 struct]} surface: {} orthviews: {} history: {} history_descrip: [] additional_info: ''

covariates "Cue effects (Zscore)"

cue_z_outcome_obj = fmri_data(filteredcon_files);
Using default mask: /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/brainmask_canlab.nii loading mask. mapping volumes. checking that dimensions and voxel sizes of volumes are the same. Pre-allocating data array. Needed: 28353708 bytes Loading image number: 71 Elapsed time is 9.208883 seconds. Image names entered, but fullpath attribute is empty. Getting path info. Number of unique values in dataset: 6767782 Bit rate: 22.69 bits
cue_z_outcome_obj.X = filtered_pain_cueeffect.cue_z_outcome;
plot(cue_z_outcome_obj)
______________________________________________________________ Outlier analysis ______________________________________________________________ global mean | global mean to var | spatial MAD | Missing values | 0 images Retained 5 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 21.13% Expected 3.55 outside 95% ellipsoid, found 9 Potential outliers based on mahalanobis distance: Bonferroni corrected: 5 images Cases 16 29 37 44 69 Uncorrected: 9 images Cases 12 16 29 34 37 43 44 48 69 Retained 10 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 50.70% Expected 3.55 outside 95% ellipsoid, found 3 Potential outliers based on mahalanobis distance: Bonferroni corrected: 0 images Cases Uncorrected: 3 images Cases 12 20 33 Mahalanobis (cov and corr, q<0.05 corrected): 5 images Outlier_count Percentage _____________ __________ global_mean 4 5.6338 global_mean_to_variance 2 2.8169 missing_values 0 0 rmssd_dvars 0 0 spatial_variability 4 5.6338 mahal_cov_uncor 9 12.676 mahal_cov_corrected 5 7.0423 mahal_corr_uncor 3 4.2254 mahal_corr_corrected 0 0 Overall_uncorrected 11 15.493 Overall_corrected 5 7.0423
Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. SPM12: spm_check_registration (v7759) 10:42:33 - 16/01/2024 ======================================================================== Display /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 (all) /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions
ans = 71×1 logical array
0 0 0 0 0 0 0 0 0 0
cue_z_outcome_obj = regress(cue_z_outcome_obj, .05, 'fdr')
Analysis: ---------------------------------- Design matrix warnings: ---------------------------------- No intercept detected, adding intercept to last column of design matrix Warning: Predictors are not centered -- intercept is not interpretable as stats for average subject Warning!!! Some observations have high leverage values relative to others, regression may be unstable. abs(z(leverage)) > 3 Warning!!! Too few variable names entered, less than size(X, 2). Names may be inaccurate. ______________________________________________________ Running regression: 99837 voxels. Design: 71 obs, 2 regressors, intercept is last Predicting exogenous variable(s) in dat.X using brain data as predictors, mass univariate Running in OLS Mode Model run in 0 minutes and 0.20 seconds Creating beta and t images, thresholding t images ______________________________________________________ Thresholding t images at 0.050000 fdr Image 1 FDR q < 0.050 threshold is 0.000000 Image 1 0 contig. clusters, sizes to Positive effect: 0 voxels, min p-value: 0.00000046 Negative effect: 0 voxels, min p-value: 0.00015773 Image 2 FDR q < 0.050 threshold is 0.026069 Image 2 0 contig. clusters, sizes to Positive effect: 51825 voxels, min p-value: 0.00000000 Negative effect: 254 voxels, min p-value: 0.00000800
cue_z_outcome_obj = struct with fields:
analysis_name: '' input_parameters: [1×1 struct] input_image_metadata: [1×1 struct] X: [71×2 double] variable_names: {2×1 cell} C: [] contrast_names: {} contrast_summary_table: [0×0 table] diagnostics: [1×1 struct] warnings: {1×4 cell} b: [1×1 statistic_image] t: [1×1 statistic_image] df: [1×1 fmri_data] sigma: [1×1 fmri_data]
cue_z_outcome_obj.t = threshold(cue_z_outcome_obj.t, .05, 'fdr');
Image 1 FDR q < 0.050 threshold is 0.000000 Image 1 0 contig. clusters, sizes to Positive effect: 0 voxels, min p-value: 0.00000046 Negative effect: 0 voxels, min p-value: 0.00015773 Image 2 FDR q < 0.050 threshold is 0.026069 Image 2 0 contig. clusters, sizes to Positive effect: 51825 voxels, min p-value: 0.00000000 Negative effect: 254 voxels, min p-value: 0.00000800
montage(cue_z_outcome_obj.t)
Setting up fmridisplay objects Compressed NIfTI files are not supported. sagittal montage: 2616 voxels displayed, 49463 not displayed on these slices axial montage: 12827 voxels displayed, 39252 not displayed on these slices
ans =
fmridisplay with properties: overlay: '/Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz' SPACE: [1×1 struct] activation_maps: {[1×1 struct]} montage: {[1×1 struct] [1×1 struct] [1×1 struct] [1×1 struct]} surface: {} orthviews: {} history: {} history_descrip: [] additional_info: ''

covariates cue vs. stim effects (raw)

cuestim_outcome_raw_obj = fmri_data(filteredcon_files);
Using default mask: /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/brainmask_canlab.nii loading mask. mapping volumes. checking that dimensions and voxel sizes of volumes are the same. Pre-allocating data array. Needed: 28353708 bytes Loading image number: 71 Elapsed time is 9.809056 seconds. Image names entered, but fullpath attribute is empty. Getting path info. Number of unique values in dataset: 6767782 Bit rate: 22.69 bits
cuestim_outcome_raw_obj.X = filtered_pain_cueeffect.cuestim_raw_outcome;
plot(cuestim_outcome_raw_obj)
______________________________________________________________ Outlier analysis ______________________________________________________________ global mean | global mean to var | spatial MAD | Missing values | 0 images Retained 5 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 21.13% Expected 3.55 outside 95% ellipsoid, found 9 Potential outliers based on mahalanobis distance: Bonferroni corrected: 5 images Cases 16 29 37 44 69 Uncorrected: 9 images Cases 12 16 29 34 37 43 44 48 69 Retained 10 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 50.70% Expected 3.55 outside 95% ellipsoid, found 3 Potential outliers based on mahalanobis distance: Bonferroni corrected: 0 images Cases Uncorrected: 3 images Cases 12 20 33 Mahalanobis (cov and corr, q<0.05 corrected): 5 images Outlier_count Percentage _____________ __________ global_mean 4 5.6338 global_mean_to_variance 2 2.8169 missing_values 0 0 rmssd_dvars 0 0 spatial_variability 4 5.6338 mahal_cov_uncor 9 12.676 mahal_cov_corrected 5 7.0423 mahal_corr_uncor 3 4.2254 mahal_corr_corrected 0 0 Overall_uncorrected 11 15.493 Overall_corrected 5 7.0423
Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. SPM12: spm_check_registration (v7759) 10:43:26 - 16/01/2024 ======================================================================== Display /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 (all) /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions
ans = 71×1 logical array
0 0 0 0 0 0 0 0 0 0
cuestim_outcome_raw_obj = regress(cuestim_outcome_raw_obj, .05, 'fdr')
Analysis: ---------------------------------- Design matrix warnings: ---------------------------------- No intercept detected, adding intercept to last column of design matrix Warning: Predictors are not centered -- intercept is not interpretable as stats for average subject Warning!!! Some observations have high leverage values relative to others, regression may be unstable. abs(z(leverage)) > 3 Warning!!! Too few variable names entered, less than size(X, 2). Names may be inaccurate. ______________________________________________________ Running regression: 99837 voxels. Design: 71 obs, 2 regressors, intercept is last Predicting exogenous variable(s) in dat.X using brain data as predictors, mass univariate Running in OLS Mode Model run in 0 minutes and 0.21 seconds Creating beta and t images, thresholding t images ______________________________________________________ Thresholding t images at 0.050000 fdr Image 1 FDR q < 0.050 threshold is 0.000028 Image 1 15 contig. clusters, sizes 1 to 17 Positive effect: 58 voxels, min p-value: 0.00000001 Negative effect: 0 voxels, min p-value: 0.00005608 Image 2 FDR q < 0.050 threshold is 0.032715 Image 2 15 contig. clusters, sizes 1 to 17 Positive effect: 64967 voxels, min p-value: 0.00000000 Negative effect: 378 voxels, min p-value: 0.00000508
cuestim_outcome_raw_obj = struct with fields:
analysis_name: '' input_parameters: [1×1 struct] input_image_metadata: [1×1 struct] X: [71×2 double] variable_names: {2×1 cell} C: [] contrast_names: {} contrast_summary_table: [0×0 table] diagnostics: [1×1 struct] warnings: {1×4 cell} b: [1×1 statistic_image] t: [1×1 statistic_image] df: [1×1 fmri_data] sigma: [1×1 fmri_data]
cuestim_outcome_raw_obj.t = threshold(cuestim_outcome_raw_obj.t, .05, 'fdr');
Image 1 FDR q < 0.050 threshold is 0.000028 Image 1 15 contig. clusters, sizes 1 to 17 Positive effect: 58 voxels, min p-value: 0.00000001 Negative effect: 0 voxels, min p-value: 0.00005608 Image 2 FDR q < 0.050 threshold is 0.032715 Image 2 15 contig. clusters, sizes 1 to 17 Positive effect: 64967 voxels, min p-value: 0.00000000 Negative effect: 378 voxels, min p-value: 0.00000508
montage(cuestim_outcome_raw_obj.t)
Setting up fmridisplay objects Compressed NIfTI files are not supported. sagittal montage: 0 voxels displayed, 58 not displayed on these slices axial montage: 14 voxels displayed, 44 not displayed on these slices sagittal montage: 3027 voxels displayed, 62318 not displayed on these slices axial montage: 16878 voxels displayed, 48467 not displayed on these slices
ans =
fmridisplay with properties: overlay: '/Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz' SPACE: [1×1 struct] activation_maps: {[1×1 struct] [1×1 struct]} montage: {[1×1 struct] [1×1 struct] [1×1 struct] [1×1 struct]} surface: {} orthviews: {} history: {} history_descrip: [] additional_info: ''

covariate "cue stim effect ratio (Z score)

cuestim_z_outcome_obj = fmri_data(filteredcon_files);
Using default mask: /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/brainmask_canlab.nii loading mask. mapping volumes. checking that dimensions and voxel sizes of volumes are the same. Pre-allocating data array. Needed: 28353708 bytes Loading image number: 71 Elapsed time is 8.784091 seconds. Image names entered, but fullpath attribute is empty. Getting path info. Number of unique values in dataset: 6767782 Bit rate: 22.69 bits
cuestim_z_outcome_obj.X = filtered_pain_cueeffect.cuestim_z_outcome;
plot(cuestim_z_outcome_obj)
______________________________________________________________ Outlier analysis ______________________________________________________________ global mean | global mean to var | spatial MAD | Missing values | 0 images Retained 5 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 21.13% Expected 3.55 outside 95% ellipsoid, found 9 Potential outliers based on mahalanobis distance: Bonferroni corrected: 5 images Cases 16 29 37 44 69 Uncorrected: 9 images Cases 12 16 29 34 37 43 44 48 69 Retained 10 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 50.70% Expected 3.55 outside 95% ellipsoid, found 3 Potential outliers based on mahalanobis distance: Bonferroni corrected: 0 images Cases Uncorrected: 3 images Cases 12 20 33 Mahalanobis (cov and corr, q<0.05 corrected): 5 images Outlier_count Percentage _____________ __________ global_mean 4 5.6338 global_mean_to_variance 2 2.8169 missing_values 0 0 rmssd_dvars 0 0 spatial_variability 4 5.6338 mahal_cov_uncor 9 12.676 mahal_cov_corrected 5 7.0423 mahal_corr_uncor 3 4.2254 mahal_corr_corrected 0 0 Overall_uncorrected 11 15.493 Overall_corrected 5 7.0423
Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. SPM12: spm_check_registration (v7759) 10:44:17 - 16/01/2024 ======================================================================== Display /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 (all) /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions
ans = 71×1 logical array
0 0 0 0 0 0 0 0 0 0
cuestim_z_outcome_obj = regress(cuestim_z_outcome_obj, .05, 'fdr')
Analysis: ---------------------------------- Design matrix warnings: ---------------------------------- No intercept detected, adding intercept to last column of design matrix Warning: Predictors are not centered -- intercept is not interpretable as stats for average subject Warning!!! Some observations have high leverage values relative to others, regression may be unstable. abs(z(leverage)) > 3 Warning!!! Too few variable names entered, less than size(X, 2). Names may be inaccurate. ______________________________________________________ Running regression: 99837 voxels. Design: 71 obs, 2 regressors, intercept is last Predicting exogenous variable(s) in dat.X using brain data as predictors, mass univariate Running in OLS Mode Model run in 0 minutes and 0.20 seconds Creating beta and t images, thresholding t images ______________________________________________________ Thresholding t images at 0.050000 fdr Image 1 FDR q < 0.050 threshold is 0.000028 Image 1 15 contig. clusters, sizes 1 to 17 Positive effect: 58 voxels, min p-value: 0.00000001 Negative effect: 0 voxels, min p-value: 0.00005608 Image 2 FDR q < 0.050 threshold is 0.032715 Image 2 15 contig. clusters, sizes 1 to 17 Positive effect: 64967 voxels, min p-value: 0.00000000 Negative effect: 378 voxels, min p-value: 0.00000508
cuestim_z_outcome_obj = struct with fields:
analysis_name: '' input_parameters: [1×1 struct] input_image_metadata: [1×1 struct] X: [71×2 double] variable_names: {2×1 cell} C: [] contrast_names: {} contrast_summary_table: [0×0 table] diagnostics: [1×1 struct] warnings: {1×4 cell} b: [1×1 statistic_image] t: [1×1 statistic_image] df: [1×1 fmri_data] sigma: [1×1 fmri_data]
cuestim_z_outcome_obj.t = threshold(cuestim_z_outcome_obj.t, .05, 'fdr');
Image 1 FDR q < 0.050 threshold is 0.000028 Image 1 15 contig. clusters, sizes 1 to 17 Positive effect: 58 voxels, min p-value: 0.00000001 Negative effect: 0 voxels, min p-value: 0.00005608 Image 2 FDR q < 0.050 threshold is 0.032715 Image 2 15 contig. clusters, sizes 1 to 17 Positive effect: 64967 voxels, min p-value: 0.00000000 Negative effect: 378 voxels, min p-value: 0.00000508
montage(cuestim_z_outcome_obj.t)
Setting up fmridisplay objects Compressed NIfTI files are not supported. sagittal montage: 0 voxels displayed, 58 not displayed on these slices axial montage: 14 voxels displayed, 44 not displayed on these slices sagittal montage: 3027 voxels displayed, 62318 not displayed on these slices axial montage: 16878 voxels displayed, 48467 not displayed on these slices
ans =
fmridisplay with properties: overlay: '/Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz' SPACE: [1×1 struct] activation_maps: {[1×1 struct] [1×1 struct]} montage: {[1×1 struct] [1×1 struct] [1×1 struct] [1×1 struct]} surface: {} orthviews: {} history: {} history_descrip: [] additional_info: ''
 

covariate: cue stim effect ratio (raw score) regularized

 
cuestim_raw_outcome_reg_obj = fmri_data(filteredcon_files);
Using default mask: /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/brainmask_canlab.nii loading mask. mapping volumes. checking that dimensions and voxel sizes of volumes are the same. Pre-allocating data array. Needed: 28353708 bytes Loading image number: 71 Elapsed time is 8.550838 seconds. Image names entered, but fullpath attribute is empty. Getting path info. Number of unique values in dataset: 6767782 Bit rate: 22.69 bits
cuestim_raw_outcome_reg_obj.X = filtered_pain_cueeffect.cuestim_raw_outcome_reg;
plot(cuestim_raw_outcome_reg_obj)
______________________________________________________________ Outlier analysis ______________________________________________________________ global mean | global mean to var | spatial MAD | Missing values | 0 images Retained 5 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 21.13% Expected 3.55 outside 95% ellipsoid, found 9 Potential outliers based on mahalanobis distance: Bonferroni corrected: 5 images Cases 16 29 37 44 69 Uncorrected: 9 images Cases 12 16 29 34 37 43 44 48 69 Retained 10 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 50.70% Expected 3.55 outside 95% ellipsoid, found 3 Potential outliers based on mahalanobis distance: Bonferroni corrected: 0 images Cases Uncorrected: 3 images Cases 12 20 33 Mahalanobis (cov and corr, q<0.05 corrected): 5 images Outlier_count Percentage _____________ __________ global_mean 4 5.6338 global_mean_to_variance 2 2.8169 missing_values 0 0 rmssd_dvars 0 0 spatial_variability 4 5.6338 mahal_cov_uncor 9 12.676 mahal_cov_corrected 5 7.0423 mahal_corr_uncor 3 4.2254 mahal_corr_corrected 0 0 Overall_uncorrected 11 15.493 Overall_corrected 5 7.0423
Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. SPM12: spm_check_registration (v7759) 10:45:05 - 16/01/2024 ======================================================================== Display /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 (all) /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions
ans = 71×1 logical array
0 0 0 0 0 0 0 0 0 0
cuestim_raw_outcome_reg_obj = regress(cuestim_raw_outcome_reg_obj, .05, 'fdr')
Analysis: ---------------------------------- Design matrix warnings: ---------------------------------- No intercept detected, adding intercept to last column of design matrix Warning: Predictors are not centered -- intercept is not interpretable as stats for average subject Warning!!! Some observations have high leverage values relative to others, regression may be unstable. abs(z(leverage)) > 3 Warning!!! Too few variable names entered, less than size(X, 2). Names may be inaccurate. ______________________________________________________ Running regression: 99837 voxels. Design: 71 obs, 2 regressors, intercept is last Predicting exogenous variable(s) in dat.X using brain data as predictors, mass univariate Running in OLS Mode Model run in 0 minutes and 0.23 seconds Creating beta and t images, thresholding t images ______________________________________________________ Thresholding t images at 0.050000 fdr Image 1 FDR q < 0.050 threshold is 0.000027 Image 1 14 contig. clusters, sizes 1 to 15 Positive effect: 56 voxels, min p-value: 0.00000003 Negative effect: 0 voxels, min p-value: 0.00009463 Image 2 FDR q < 0.050 threshold is 0.031342 Image 2 14 contig. clusters, sizes 1 to 15 Positive effect: 62212 voxels, min p-value: 0.00000000 Negative effect: 373 voxels, min p-value: 0.00000586
cuestim_raw_outcome_reg_obj = struct with fields:
analysis_name: '' input_parameters: [1×1 struct] input_image_metadata: [1×1 struct] X: [71×2 double] variable_names: {2×1 cell} C: [] contrast_names: {} contrast_summary_table: [0×0 table] diagnostics: [1×1 struct] warnings: {1×4 cell} b: [1×1 statistic_image] t: [1×1 statistic_image] df: [1×1 fmri_data] sigma: [1×1 fmri_data]
cuestim_raw_outcome_reg_obj.t = threshold(cuestim_raw_outcome_reg_obj.t, .05, 'fdr');
Image 1 FDR q < 0.050 threshold is 0.000027 Image 1 14 contig. clusters, sizes 1 to 15 Positive effect: 56 voxels, min p-value: 0.00000003 Negative effect: 0 voxels, min p-value: 0.00009463 Image 2 FDR q < 0.050 threshold is 0.031342 Image 2 14 contig. clusters, sizes 1 to 15 Positive effect: 62212 voxels, min p-value: 0.00000000 Negative effect: 373 voxels, min p-value: 0.00000586
montage(cuestim_raw_outcome_reg_obj.t)
Setting up fmridisplay objects Compressed NIfTI files are not supported. sagittal montage: 0 voxels displayed, 56 not displayed on these slices axial montage: 16 voxels displayed, 40 not displayed on these slices sagittal montage: 2945 voxels displayed, 59640 not displayed on these slices axial montage: 16041 voxels displayed, 46544 not displayed on these slices
ans =
fmridisplay with properties: overlay: '/Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz' SPACE: [1×1 struct] activation_maps: {[1×1 struct] [1×1 struct]} montage: {[1×1 struct] [1×1 struct] [1×1 struct] [1×1 struct]} surface: {} orthviews: {} history: {} history_descrip: [] additional_info: ''

covariate: cue stim effect ratio (Z score) regularized

 
cuestim_z_outcome_reg_obj = fmri_data(filteredcon_files);
Using default mask: /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/brainmask_canlab.nii loading mask. mapping volumes. checking that dimensions and voxel sizes of volumes are the same. Pre-allocating data array. Needed: 28353708 bytes Loading image number: 71 Elapsed time is 7.928106 seconds. Image names entered, but fullpath attribute is empty. Getting path info. Number of unique values in dataset: 6767782 Bit rate: 22.69 bits
cuestim_z_outcome_reg_obj.X = filtered_pain_cueeffect.cuestim_z_outcome_reg;
plot(cuestim_z_outcome_reg_obj)
______________________________________________________________ Outlier analysis ______________________________________________________________ global mean | global mean to var | spatial MAD | Missing values | 0 images Retained 5 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 21.13% Expected 3.55 outside 95% ellipsoid, found 9 Potential outliers based on mahalanobis distance: Bonferroni corrected: 5 images Cases 16 29 37 44 69 Uncorrected: 9 images Cases 12 16 29 34 37 43 44 48 69 Retained 10 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 50.70% Expected 3.55 outside 95% ellipsoid, found 3 Potential outliers based on mahalanobis distance: Bonferroni corrected: 0 images Cases Uncorrected: 3 images Cases 12 20 33 Mahalanobis (cov and corr, q<0.05 corrected): 5 images Outlier_count Percentage _____________ __________ global_mean 4 5.6338 global_mean_to_variance 2 2.8169 missing_values 0 0 rmssd_dvars 0 0 spatial_variability 4 5.6338 mahal_cov_uncor 9 12.676 mahal_cov_corrected 5 7.0423 mahal_corr_uncor 3 4.2254 mahal_corr_corrected 0 0 Overall_uncorrected 11 15.493 Overall_corrected 5 7.0423
Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. Compressed NIfTI files are not supported. SPM12: spm_check_registration (v7759) 10:45:54 - 16/01/2024 ======================================================================== Display /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 (all) /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 /Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz,1 Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions
ans = 71×1 logical array
0 0 0 0 0 0 0 0 0 0
cuestim_z_outcome_reg_obj = regress(cuestim_z_outcome_reg_obj, .05, 'fdr')
Analysis: ---------------------------------- Design matrix warnings: ---------------------------------- No intercept detected, adding intercept to last column of design matrix Warning: Predictors are not centered -- intercept is not interpretable as stats for average subject Warning!!! Some observations have high leverage values relative to others, regression may be unstable. abs(z(leverage)) > 3 Warning!!! Too few variable names entered, less than size(X, 2). Names may be inaccurate. ______________________________________________________ Running regression: 99837 voxels. Design: 71 obs, 2 regressors, intercept is last Predicting exogenous variable(s) in dat.X using brain data as predictors, mass univariate Running in OLS Mode Model run in 0 minutes and 0.20 seconds Creating beta and t images, thresholding t images ______________________________________________________ Thresholding t images at 0.050000 fdr Image 1 FDR q < 0.050 threshold is 0.000000 Image 1 0 contig. clusters, sizes to Positive effect: 0 voxels, min p-value: 0.00000237 Negative effect: 0 voxels, min p-value: 0.00021297 Image 2 FDR q < 0.050 threshold is 0.001164 Image 2 0 contig. clusters, sizes to Positive effect: 2318 voxels, min p-value: 0.00000036 Negative effect: 5 voxels, min p-value: 0.00029440
cuestim_z_outcome_reg_obj = struct with fields:
analysis_name: '' input_parameters: [1×1 struct] input_image_metadata: [1×1 struct] X: [71×2 double] variable_names: {2×1 cell} C: [] contrast_names: {} contrast_summary_table: [0×0 table] diagnostics: [1×1 struct] warnings: {1×4 cell} b: [1×1 statistic_image] t: [1×1 statistic_image] df: [1×1 fmri_data] sigma: [1×1 fmri_data]
cuestim_z_outcome_reg_obj.t = threshold(cuestim_z_outcome_reg_obj.t, .05, 'fdr');
Image 1 FDR q < 0.050 threshold is 0.000000 Image 1 0 contig. clusters, sizes to Positive effect: 0 voxels, min p-value: 0.00000237 Negative effect: 0 voxels, min p-value: 0.00021297 Image 2 FDR q < 0.050 threshold is 0.001164 Image 2 0 contig. clusters, sizes to Positive effect: 2318 voxels, min p-value: 0.00000036 Negative effect: 5 voxels, min p-value: 0.00029440
montage(cuestim_z_outcome_reg_obj.t)
Setting up fmridisplay objects Compressed NIfTI files are not supported. sagittal montage: 297 voxels displayed, 2026 not displayed on these slices axial montage: 292 voxels displayed, 2031 not displayed on these slices
ans =
fmridisplay with properties: overlay: '/Users/h/Documents/MATLAB/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/fmriprep20_template.nii.gz' SPACE: [1×1 struct] activation_maps: {[1×1 struct]} montage: {[1×1 struct] [1×1 struct] [1×1 struct] [1×1 struct]} surface: {} orthviews: {} history: {} history_descrip: [] additional_info: ''

compile Tmaps and apply NPS

cue_raw_outcome = apply_nps(cue_raw_outcome.t);
NPS values for series 1 Unknown image names 17.3451 Unknown image names 35.5074
cue_z_outcome = apply_nps(cue_z_outcome_obj.t);
NPS values for series 1 Unknown image names 17.4539 Unknown image names 35.3987
cuestim_outcome_raw = apply_nps(cuestim_outcome_raw_obj.t);
NPS values for series 1 Unknown image names 6.8085 Unknown image names 49.7159
cuestim_z_outcome = apply_nps(cuestim_z_outcome_obj.t);
NPS values for series 1 Unknown image names 6.8085 Unknown image names 49.7159
cuestim_raw_outcome_reg = apply_nps(cuestim_raw_outcome_reg_obj.t)
NPS values for series 1 Unknown image names 7.5542 Unknown image names 46.9010
cuestim_raw_outcome_reg = 1×1 cell array
{2×1 double}
cuestim_z_outcome_reg = apply_nps(cuestim_z_outcome_reg_obj.t);
NPS values for series 1 Unknown image names 5.7982 Unknown image names 16.2841
 
cue_effects = table(cue_raw_outcome{1}(2), ...
cue_z_outcome{1}(2), ...
cuestim_outcome_raw{1}(2), ...
cuestim_z_outcome{1}(2), ...
cuestim_raw_outcome_reg{1}(2),...
cuestim_z_outcome_reg{1}(2));
cue_effects.Properties.VariableNames = {'Cue (Raw)', 'Cue (Z)', 'Cue/Stim (Raw)', 'Cue/Stim (Z)', 'Cue+1/Stim+1 (raw)', 'Cue+1/Stim+1 (Z)'}
cue_effects = 1×6 table
 Cue (Raw)Cue (Z)Cue/Stim (Raw)Cue/Stim (Z)Cue+1/Stim+1 (raw)Cue+1/Stim+1 (Z)
135.507435.398749.715949.715946.901016.2841